﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using TA.DotNetUtils;

namespace TA.Turbo.Controls
{
	/// <summary>
	/// The next page group button.
	/// </summary>
	public class RepeaterPageButtonNextGroup : BaseRepeaterPageButtonGroup
	{
		internal RepeaterPageButtonNextGroup(Repeater repeater)
			: base(repeater)
		{

		}
		/// <summary>
		/// Gets PagerSettings.NextGroup.
		/// </summary>
		public override PagerElement PagerElement
		{
			get { return this.PagerSettings.NextGroup; }
		}
		/// <summary>
		/// Gets the index which is the length of group to the right from the Repeater's current page index.
		/// </summary>
		public override int Index
		{
			get { return Math.Min(this.Repeater.NumPages - 1, this.Repeater.ActualPageIndex + this.PagerSettings.ButtonCount); }
		}
		/// <summary>
		/// Gets true if no hidden page buttons on the right.
		/// </summary>
		public override bool Selected
		{
			get
			{
				return this.Repeater.PagesRange.End == this.Repeater.NumPages;
			}
		}
		/// <summary>
		/// Gets "next_group".
		/// </summary>
		public override string CssClass
		{
			get { return "next_group"; }
		}
	}
}